package cn.edu.demo.service;

import cn.edu.demo.mapper.CarMapper;
import cn.edu.demo.pojo.Car;
import cn.edu.demo.pojo.CarExample;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CarServiceImpl implements CarService {
    @Autowired
    CarMapper carMapper;


    @Override
    public Car getCar(String carId) {
        CarExample example = new CarExample();
        CarExample.Criteria criteria = example.or();
        criteria.andCarIdEqualTo(carId);
        return carMapper.selectByExample(example).size()!=0?carMapper.selectByExample(example).get(0):null;
    }
}
